package com.github.dice.controller;

import com.github.dice.dto.ResultDTO;
import com.github.dice.service.IRoomOwnerService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author roy.caix 2018-11-18 7:36 PM
 **/
@RestController
@RequestMapping("/room")
public class RoomController extends BaseController {

    @Resource
    private IRoomOwnerService roomOwnerService;

    @RequestMapping("/delRoom")
    public ResultDTO delRoom(@RequestParam("roomNumber") String roomNumber) {
        roomOwnerService.deleteRoomAndAllMapping(roomNumber);
        return new ResultDTO();
    }

}
